{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">班级管理</li>
            <li class=""><a href="{:url('admin/classes/add')}">添加班级</a></li>
        </ul>
        <div class="layui-tab-content">

            <form class="layui-form layui-form-pane" action="{:url('admin/classes/index')}" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">班级名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="keyword" value="{$keyword}" placeholder="请输入班级名" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <form action="" method="post" class="ajax-form">
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 10px;">ID</th>
                            <th style="width: 30px;">班级名称</th>
                            <th style="width: 30px;">开班日期</th>
                            <th style="width: 30px;">结课日期</th>
                            <th style="width: 10px;">最大人数</th>
                            <th style="width: 50px;">创建人</th>
                            <th style="width: 100px;">备注</th>
                            <th style="width: 100px;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="class_list" id="vo" empty="暂时没有数据" }
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.class_name}</td>
                            <td>{$vo.start_date}</td>
                            <td>{$vo.end_date}</td>
                            <td>{$vo.max_person}</td>
                            <td>{$vo.username}</td>
                            <td>
                                <a href="javascript:;" class="open-content"
                                   onclick="more('{$vo.class_name}','{$vo.remark}')">{:cut_string($vo['remark'], 20)}</a>
                            </td>
                            <td>
                                <a href="{:url('admin/classes/edit',['id'=>$vo['id']])}"
                                   class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                <a href="{:url('admin/classes/delete',['id'=>$vo['id']])}"
                                   class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$class_list->render()}
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    function more(class_name,remark){
        layer.open({
            type: 1,
            skin: 'open-class',
            title:[class_name + '-备注', 'font-size:18px;'],
            area: ['500px', '300px'],
            content: remark
        });
    }
</script>
{/block}